home *** CD-ROM | disk | FTP | other *** search
-
- ; Specimen (block-)filter module (*.FM)
- ; (c)1999 Richard Gordon Faika
-
- ; --------------------------------------------------------------------
- ; Get parameters
- ; Here the required parameters are fetched from the stack.
- ; --------------------------------------------------------------------
-
- move 4(sp),d0 ; Get function number
- move.l 6(sp),a1 ; Get string start address
- move 14(sp),d1 ; Get string length
-
- tst d0 ; Filter?
- beq filter
-
-
-
-
- ; --------------------------------------------------------------------
- ; Evaluate function number
- ; --------------------------------------------------------------------
-
- cmpi #1,d0
- bne case1
- bra GetInfo ; Info
- case1: cmpi #2,d0
- bne case2
- bra ModInit ; Init
- case2: cmpi #3,d0
- bne noFunc
- bra ModExit ; Exit
-
-
- ; --------------------------------------------------------------------
- ; Module initialisation
- ; --------------------------------------------------------------------
- ModInit: clr.l d0
- rts
-
-
-
- ; --------------------------------------------------------------------
- ; Module deinitialisation
- ; --------------------------------------------------------------------
- ModExit: clr.l d0
- rts
-
-
-
- ; --------------------------------------------------------------------
- ; Return info-text pointer
- ; The info-text will be displayed in the module's info-dialog by Luna,
- ; when the user requests module information for this module.
- ; --------------------------------------------------------------------
- GetInfo: lea.l info(pc),a0 ; Returns a pointer to the info-text
- move.l a0,d0
- rts
-
-
-
-
-
- ; --------------------------------------------------------------------
- ; Unknown function number
- ; --------------------------------------------------------------------
- noFunc: moveq.l #-32,d0
- rts
-
-
-
-
- ; --------------------------------------------------------------------
- ; Filter routine
- ; The actual filtering routine, with which one can alter the text.
- ; For text length changes or similar, one should write to the working
- ; buffer and return a 1.
- ; --------------------------------------------------------------------
- filter: tst d1
- beq exit
- bra goin
- loop:
- move.b (a1),d0
- rol.b #4,d0 ; Stupid, but effective =:)
- move.b d0,(a1)+
- goin:
- dbra d1,loop
- exit: clr.l d0 ; 0 = OK
- rts
-
-
-
- ; --------------------------------------------------------------------
- ; Info-text
- ; The info-text has to follow this structure, because 6 strings are always
- ; read one after the other. So the minimum is a nullbyte per entry.
- ; --------------------------------------------------------------------
- info: dc.b ' Specimen module',0 ; Module info for popup, max. 24 chars.+nullbyte
- dc.b 'Author's name',0 ; Author's name, max. 20 chars.+nullbyte
- dc.b 'Info-text line 1',0 ; Max. 40 characters+nullbyte
- dc.b 'Info-text line 2',0 ; " "
- dc.b 'Info-text line 3',0 ; " "
- dc.b 'Info-text line 4',0 ; " "
-
-